<?php
/**
 * Created by PhpStorm.
 * User: 程序猴
 * Date: 2018/4/14
 *  Q Q: 505413
 * Time: 14:47
 */
namespace app\admin\controller;
use app\admin\controller\Base;

class Clear extends Base
{
    public function index()
    {
        return $this->fetch();
    }
    //删除缓存
    public function clearRuntime()
    {
        if (false === (delete_dir_file(CACHE_PATH) && delete_dir_file(TEMP_PATH))) {
            return json(['code' => 0, 'msg' => '已经很干净了，不需要清除了']);
        } else {
            return json(['code' => 1, 'msg' => '清除缓存成功']);
        }
    }

}